< previous page page_491 next page >

Page 491
The Microsoft Word Object Library
To use Word objects from Visual Basic, you must have Word installed on your computer. After Word has been installed, you should see the Microsoft Word Object Library available in Visual Basic's References dialog box, as shown in Figure 22.1.
0491-01.jpg
Figure 22.1
To use Word objects in Visual Basic, add
a reference to the Word Object Library. (The
Word reference from Office 97 is shown here).
To add the reference, choose References from the Project menu, and place a check mark next to the Microsoft Word Object Library. After referencing the Word Object Library, you can press F2, or choose View, Object Browser to see the objects Word makes available to your program, as in Figure 22.2.
0491-02.jpg
Figure 22.2
The Object Browser is a useful tool for discovering what
you can do with Word and Excel from Visual Basic.
In the following sections, you explore how to manipulate Microsoft Word from Visual Basic by using the Microsoft Word Object Library.

 
< previous page page_491 next page >